﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers {
    import flash.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class GameStateChangedCommand extends Command {

		[Inject]
        public var gameStateModel:GameStateModel;
		[Inject]
        public var tutorialModel:TutorialModel;

        override public function execute():void{
            var _local1:int = this.gameStateModel.state;
            switch (_local1){
                case GameStateModel.STATE_GAME_TUTORIAL:
                    this.onGameStateTutorial();
                    break;
                case GameStateModel.STATE_GAME_RUNNING:
                    this.tutorialModel.state = TutorialModel.END;
                    dispatch(new Event(EventConstants.ENABLE_GAME_VIEW_NAVIGATION));
                    break;
                default:
                    break;
            };
        }
        private function onGameStateTutorial():void{
            dispatch(new Event(EventConstants.DISABLE_BUILDING_NAVIGATION));
        }

    }
}//package net.wooga.pets.controllers 
